package com.ubaer.zsycz.httpapi;


import com.ubaer.zsycz.model.BaseModel;
import com.ubaer.zsycz.model.LoginModel;
import com.ubaer.zsycz.model.OrderDetailsModel;
import com.ubaer.zsycz.model.OrderModel;
import com.ubaer.zsycz.rxjava.RxSchedulers;

import org.json.JSONObject;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;


/**
 * Created by Administrator on 2018/7/13 0013.
 */

public class HttpApi {
    HttpService httpService;

    @Inject
    public HttpApi(HttpService httpService) {
        this.httpService = httpService;
    }

    public Observable<BaseModel<LoginModel>> login(String phone, String password) {
        return httpService.login(phone, password)
                .compose(RxSchedulers.observableTransformer);
    }

    public Observable<BaseModel<List<OrderModel>>> getOrderList(String status, String keyword, String page, String page_size) {
        return httpService.getOrderList(status, keyword, page, page_size)
                .compose(RxSchedulers.observableTransformer);
    }

    public Observable<BaseModel<List<String>>> ProcessingOrder(String id, String status, String reason) {
        return httpService.ProcessingOrder(id, status, reason)
                .compose(RxSchedulers.observableTransformer);
    }

    public Observable<BaseModel<List<String>>> ProcessingOrders(String id) {
        return httpService.ProcessingOrders(id)
                .compose(RxSchedulers.observableTransformer);
    }

    public Observable<BaseModel<OrderDetailsModel>> getOrderDetails(String id) {
        return httpService.getOrderDetails(id)
                .compose(RxSchedulers.observableTransformer);
    }


}
